//
//  BaseTableViewController.swift
//  XiaozhuangWeibo
//
//  Created by Maxwell on 11/5/18.
//  Copyright © 2018 Maxwell. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController,VisitorViewDelegate {
    var guestView:VisitorView?
    let userLogin:Bool!
    var access_token:String = ""
    
    init(userLogin:Bool){
        self.userLogin = userLogin
        super.init(nibName:nil, bundle:nil)
    }
    
    init(userLogin:Bool,access_token:String){
        self.userLogin = userLogin
        self.access_token = access_token
        super.init(nibName:nil, bundle:nil)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func loadView() {
        userLogin ? super.loadView() : userNotlogin()
    }
   
    func userNotlogin(){
        guestView = VisitorView()
        guestView?.degegate = self
        view = guestView //根视图
        view.backgroundColor = UIColor.white
    }
    func registerWillClicked() {
        print("base注册")
    }
    func longinWillClicked() {
        let oaVC = OAuthViewController()
        let nav = UINavigationController()
        nav.addChild(oaVC)
        present(nav, animated: true, completion: nil)
    }
    
}


